package sms;

import java.time.LocalDate;

public class MiddleStudent extends Student implements EveningStudy {
    /*历史成绩*/
    private int historyScore;
    /*物理成绩*/
    private int physicsScore;

    public MiddleStudent(int studentId, String name, int chineseScore, int mathScore, int historyScore, int physicsScore) {
        super(studentId, name, chineseScore, mathScore);
        this.historyScore = historyScore;
        this.physicsScore = physicsScore;
    }

    public MiddleStudent(int studentId, String name, int chineseScore, int mathScore, LocalDate enrollmentDates, int historyScore, int physicsScore) {
        super(studentId, name, chineseScore, mathScore, enrollmentDates);
        this.historyScore = historyScore;
        this.physicsScore = physicsScore;
    }

    public int getHistoryScore() {
        return historyScore;
    }

    public void setHistoryScore(int historyScore) {
        this.historyScore = historyScore;
    }

    public int getPhysicsScore() {
        return physicsScore;
    }

    public void setPhysicsScore(int physicsScore) {
        this.physicsScore = physicsScore;
    }

    /*重写晚自习方法*/
    @Override
    public void eveningStudy() {
        System.out.println("中学生" + getName() + "正在上晚自习");
    }
    /*中学生总成绩*/
    @Override
    public int getTotalScore() {
        return super.getTotalScore() + historyScore + physicsScore;
    }
    /*显示学生信息*/
    @Override
    public String toString() {
        return getStudentId() + " " + getName() + " " + getChineseScore() + " "
                + getMathScore() + " " + getHistoryScore() + " " + getPhysicsScore() + " " + getEnrollmentDates() + " "
                + getTotalScore();
    }
}
